package com.ultra.activity;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;
import android.widget.ScrollView;

import com.ultra.R;
import com.ultra.common.Handle;
import com.ultra.ui.UI;
import com.ultra.util.ImgUtil;

/**
 * 
 * @ClassName: LoginActivity 
 * @Description: 登录界面
 * @author jiangshidi QQ:82421098 
 * @date 2013-4-9 上午11:42:54 
 *
 */
public class LoginActivity extends Activity {
	/**
	 * Title: onCreate
	 * Description: 初始化登录页面
	 * @param savedInstanceState 
	 * @see android.app.Activity#onCreate(android.os.Bundle) 
	 */
	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.activity_login);
		
		//登录界面更换背景图
		ScrollView loginForm = (ScrollView) findViewById(R.id.login_form);
		loginForm.setBackgroundDrawable(ImgUtil.getImgDrawable(ImgUtil.BG,UI.BACKGROUND.LOGIN_BG));
		
		//登录按钮事件
		Button bt = (Button)findViewById(R.id.sign_in_button);
		bt.setOnClickListener(new OnClickListener() {
			@Override
			public void onClick(View v) {
				new Handle(LoginActivity.this){

					@Override
					public void start() {
						msg.obj = "我是处理后的---"+123;
						System.out.println("我是继承的---"+123);
					}

					@Override
					public void finish() {
						System.out.println(msg.obj);
						Intent intent = new Intent(LoginActivity.this,FrameActivity.class);//跳转主界面
						startActivity(intent);
					}
				};
			}
		});
	}
}
